####################################################################################
## MSI
## 1、maf转vcf
## CDS突变
mkdir -p ${SigProfiler_path}/vcf_combine
mkdir -p ${SigProfiler_path}/extractor_combine
## 总的突变
mkdir -p ${SigProfiler_path}/vcf_combine_allMuts
mkdir -p ${SigProfiler_path}/extractor_combine_allMuts

rm -rf ${SigProfiler_path}/vcf_combine/*
rm -rf ${SigProfiler_path}/vcf_combine_allMuts/*

for sample in `cat ${maf_public_path}/All_use.addVAF.maf | awk -F'\t' '{print $3}' | grep -v Tumor_Sample_Barcode | sort -u`
do
sh ${scripts_path}/sigprofile/denovoSig_1_mafToVCF.sh ${sample}
done

## 2、提取突变信号
## 进入python中可以运行，直接运行脚本会有Bug
## CDS
rm -rf ${SigProfiler_path}/extractor_combine/*
${python} ${scripts_path}/sigprofile/denovoSig_2_SigProfiler.combine.py
echo " sleep 1d " | \
qsub -N "denovoSig" -l nodes=comput13:ppn=20,mem=20gb,walltime=240:00:00 -q smp -d ${Qsub_log_path}

## 所有突变
#rm -rf ${SigProfiler_path}/extractor_combine_allMuts/*
#${python} ${scripts_path}/sigprofile/denovoSig_2_SigProfiler.combine_allMuts.py

## 3、denovoToDecompose
${python} ${scripts_path}/sigprofile/denovoSig_3_decompose.py \
${SigProfiler_path}/extractor_combine

## 4、decompose的文件链接
## decompose的信号组成
cp -rf ${SigProfiler_path}/extractor_combine/decompose/SBS96/Decompose_Solution/Activities/Decompose_Solution_Activities.txt \
${SigProfiler_path}/decompose/combine_SBS96.txt
## 总体的突变数量
cp -rf ${SigProfiler_path}/extractor_combine/SBS96/Samples.txt ${SigProfiler_path}/decompose/combine_SBS96.AllMuts.txt


####################################################################################
## 20230302
## 把所有的vcf文件放在一个文件夹下面
